package lbframework.gui;

import java.awt.event.KeyEvent;
import lbframework.bean.dialog.LBDialog;

public class SobreGUI extends LBDialog {

    public SobreGUI() throws Exception {
        initComponents();

        centralizarForm();

        this.setModal(true);
    }

    public void setSobre(String i_programa, String i_versao, String i_data) {
        lblPrograma.setText(i_programa);
        lblVersao.setText("Versão " + i_versao);
        lblData.setText("Data: " + i_data);
    }

    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lblPrograma = new lbframework.bean.label.LBLabel();
        lblVersao = new lbframework.bean.label.LBLabel();
        lblData = new lbframework.bean.label.LBLabel();
        vRLabel2 = new lbframework.bean.label.LBLabel();
        vRLabel1 = new lbframework.bean.label.LBLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setUndecorated(true);
        addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                formMouseClicked(evt);
            }
        });
        addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                formKeyPressed(evt);
            }
        });
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        lblPrograma.setForeground(new java.awt.Color(51, 51, 51));
        lblPrograma.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        lblPrograma.setText("Programa");
        lblPrograma.setFont(new java.awt.Font("Tahoma", 1, 18));
        getContentPane().add(lblPrograma, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 10, 200, 30));

        lblVersao.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        lblVersao.setText("X.X.X");
        getContentPane().add(lblVersao, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 110, 130, -1));

        lblData.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        lblData.setText("XX/XX/XXXX");
        getContentPane().add(lblData, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 130, 130, -1));

        vRLabel2.setText("Copyright © LB Software");
        getContentPane().add(vRLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 220, -1, -1));

        vRLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        vRLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/lbframework/img/sobre.png"))); // NOI18N
        vRLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                vRLabel1MouseClicked(evt);
            }
        });
        vRLabel1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                vRLabel1KeyPressed(evt);
            }
        });
        getContentPane().add(vRLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 390, 260));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseClicked
        this.dispose();
    }//GEN-LAST:event_formMouseClicked

    private void vRLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_vRLabel1MouseClicked
        this.dispose();
    }//GEN-LAST:event_vRLabel1MouseClicked

    private void formKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_formKeyPressed
        if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) {
            this.dispose();
        }
    }//GEN-LAST:event_formKeyPressed

    private void vRLabel1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_vRLabel1KeyPressed
        if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) {
            this.dispose();
        }
    }//GEN-LAST:event_vRLabel1KeyPressed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private lbframework.bean.label.LBLabel lblData;
    private lbframework.bean.label.LBLabel lblPrograma;
    private lbframework.bean.label.LBLabel lblVersao;
    private lbframework.bean.label.LBLabel vRLabel1;
    private lbframework.bean.label.LBLabel vRLabel2;
    // End of variables declaration//GEN-END:variables
}